/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainView.java
 *
 * Created on 16-04-2011, 13:05:08
 */
package views;

import common.Session;
import controllers.ContingentController;
import controllers.NoteController;
import controllers.PersonController;
import java.awt.Window;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import models.Person;
import models.Storage;
import controllers.StorageController;
import controllers.StorageItemController;
import controllers.TeamController;
import controllers.TrainingController;
import controllers.RentItemController;
import models.Note;
import models.Rent;
import models.StorageItem;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 *
 * @author pelle
 */
public class MainView extends AbstractView {
    // Medlemskab

    private PersonController personCtr = new PersonController();
    private ArrayList<Person> searchPersons = new ArrayList<Person>();
    private ArrayList<StorageItem> searchStorage = new ArrayList<StorageItem>();
    private ArrayList<Rent> searchRent = new ArrayList<Rent>();
    // Lager
    //private ArrayList<Storage> searchStorage = new ArrayList<Storage>();
    private StorageController stoCtr = new StorageController();
    private StorageItemController stoItemCtr = new StorageItemController();
    private RentItemController rentCtr = new RentItemController();
    // Noter
    private NoteController noteCtr = new NoteController();
    private ArrayList<Note> notesList = new ArrayList<Note>();
    // Kontigent
    private ContingentController contingentCtr = new ContingentController();
    // Training
    private TrainingController trainingCtr = new TrainingController();
    // Hold
    private TeamController teamCtr = new TeamController();

    /** Creates new form MainView */
    public MainView() {
        initComponents();
        setValues();
    }

    public void setValues() {
        this.name.setText(Session.person.getName());

        // Tællere i toppen af menuen
        this.countMembersLabel.setText("" + this.personCtr.getMemberCount());
        this.countTrainersLabel.setText("" + this.personCtr.getTrainerCount());
        this.countNotesLabel.setText("" + this.noteCtr.getNoteCount());
        this.countContingentLabel.setText("" + this.contingentCtr.getMissingContingentCount());
        this.countMatchesLabel.setText("" + this.trainingCtr.getMatchCount() + "/" + this.trainingCtr.getMatchWonCount());
        this.countTeamsLabel.setText("" + this.teamCtr.getTeamCount());
        
        for (Person p : personCtr.getAllPersons()) {
            //Item I = new Item(p.getId(), p.getName());
            ddPerson.addItem(p.getName() + " (" + p.getId() + ")");
            //ddPersonList.add();

            //ddPerson.addItem(p.getName()(p.getId()));
        }
        for (StorageItem si : stoItemCtr.getAllItems()) {
            //Item itemInStock = new Item(si.getStorageId(), si.getStoObj().getName());
            //ddStockList.add();
            ddMatriale.addItem(si.getStoObj().getName() + " (" + si.getStorageId() + ")");
        }
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        name = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        createPersonBtn = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        selectPersonBtn = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        personList = new javax.swing.JList();
        jLabel9 = new javax.swing.JLabel();
        nameField = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        cprField = new javax.swing.JTextField();
        searchPersonBtn = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        noteTitle = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        noteBoth = new javax.swing.JRadioButton();
        notePublic = new javax.swing.JRadioButton();
        notePrivate = new javax.swing.JRadioButton();
        noteSearchBtn = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        noteList = new javax.swing.JList();
        openNoteBtn = new javax.swing.JButton();
        createNoteBtn = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jButton8 = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jButton9 = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        listRent = new javax.swing.JList();
        jLabel14 = new javax.swing.JLabel();
        searchBtn2 = new javax.swing.JButton();
        ddMatriale = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        ddPerson = new javax.swing.JComboBox();
        jPanel5 = new javax.swing.JPanel();
        jButton6 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        btnRediger = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        listStorge = new javax.swing.JList();
        jLabel12 = new javax.swing.JLabel();
        txtsearchStorageName = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txtSearchStorageSerial = new javax.swing.JTextField();
        searchBtn1 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        countMembersLabel = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        countContingentLabel = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        countMatchesLabel = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        countTrainersLabel = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        countNotesLabel = new javax.swing.JLabel();
        countTeamsLabel = new javax.swing.JLabel();
        logoutBtn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Lindholm IF");

        name.setFont(new java.awt.Font("Lucida Grande", 1, 18));
        name.setText("Dit fulde *hik* navn");

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/lif-logo.png"))); // NOI18N

        createPersonBtn.setText("Opret ny person");
        createPersonBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                createPersonBtnActionPerformed(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Find person"));

        selectPersonBtn.setText("Vælg person");
        selectPersonBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selectPersonBtnActionPerformed(evt);
            }
        });

        personList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(personList);

        jLabel9.setText("Navn:");

        nameField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                nameFieldKeyReleased(evt);
            }
        });

        jLabel10.setText("Cpr. nr.:");

        cprField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        cprField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                cprFieldKeyReleased(evt);
            }
        });

        searchPersonBtn.setText("Søg");
        searchPersonBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchPersonBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(nameField, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cprField, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(searchPersonBtn))
                    .addComponent(selectPersonBtn, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 772, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchPersonBtn)
                    .addComponent(jLabel10)
                    .addComponent(cprField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectPersonBtn)
                .addGap(35, 35, 35))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(createPersonBtn))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(createPersonBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Medlemskab", jPanel1);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 824, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 356, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Hold", jPanel2);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 824, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 356, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Træninger", jPanel3);

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Fælles notater"));

        jLabel7.setText("Søg efter:");

        noteTitle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                noteTitleKeyReleased(evt);
            }
        });

        jLabel8.setText("Vis:");

        buttonGroup1.add(noteBoth);
        noteBoth.setSelected(true);
        noteBoth.setText("Begge");

        buttonGroup1.add(notePublic);
        notePublic.setText("Offentlige");

        buttonGroup1.add(notePrivate);
        notePrivate.setText("Private");

        noteSearchBtn.setText("Søg");
        noteSearchBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noteSearchBtnActionPerformed(evt);
            }
        });

        noteList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        noteList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                noteListMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(noteList);

        openNoteBtn.setText("Åben notat");
        openNoteBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openNoteBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 759, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addComponent(noteBoth)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(notePublic)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(notePrivate))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                                .addComponent(noteTitle, javax.swing.GroupLayout.DEFAULT_SIZE, 649, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(noteSearchBtn))))
                    .addComponent(openNoteBtn, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(noteTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noteSearchBtn))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(noteBoth)
                    .addComponent(notePublic)
                    .addComponent(notePrivate))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(openNoteBtn))
        );

        createNoteBtn.setText("Opret nyt notat");
        createNoteBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                createNoteBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(createNoteBtn))
                .addGap(23, 23, 23))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(createNoteBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(72, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Notater", jPanel4);

        jButton8.setText("Opret nyt udlån");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("Find udlån"));

        jButton9.setText("Åben udlån");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        listRent.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane4.setViewportView(listRent);

        jLabel14.setText("Matriale:");

        searchBtn2.setText("Søg");
        searchBtn2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchBtn2ActionPerformed(evt);
            }
        });

        ddMatriale.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vælg matriale" }));

        jLabel15.setText("Person:");

        ddPerson.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vælg person" }));

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 772, Short.MAX_VALUE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ddMatriale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ddPerson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 435, Short.MAX_VALUE)
                        .addComponent(searchBtn2))
                    .addComponent(jButton9, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(searchBtn2)
                    .addComponent(ddMatriale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15)
                    .addComponent(ddPerson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton9)
                .addGap(18, 18, 18))
        );

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton8)
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jButton8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Udlån", jPanel10);

        jButton6.setText("Opret nyt matriale");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Find lagervare"));

        btnRediger.setText("Åben matriel");
        btnRediger.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRedigerActionPerformed(evt);
            }
        });

        listStorge.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane3.setViewportView(listStorge);

        jLabel12.setText("Navn:");

        txtsearchStorageName.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtsearchStorageNameKeyReleased(evt);
            }
        });

        jLabel13.setText("Serie nr.:");

        txtSearchStorageSerial.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtSearchStorageSerial.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtSearchStorageSerialKeyReleased(evt);
            }
        });

        searchBtn1.setText("Søg");
        searchBtn1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchBtn1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 772, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtsearchStorageName, javax.swing.GroupLayout.DEFAULT_SIZE, 495, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtSearchStorageSerial, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(searchBtn1))
                    .addComponent(btnRediger, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(txtsearchStorageName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchBtn1)
                    .addComponent(jLabel13)
                    .addComponent(txtSearchStorageSerial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnRediger)
                .addGap(35, 35, 35))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton6)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jButton6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Lager", jPanel5);

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Overblik"));

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel1.setText("Antal medlemmer:");

        countMembersLabel.setText("0");

        jLabel3.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel3.setText("Ubetalte kontigenter:");

        countContingentLabel.setText("0");

        jLabel6.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel6.setText("Kampe spillet/vundet:");

        countMatchesLabel.setText("0/0");

        jLabel16.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel16.setText("Antal trænere:");

        countTrainersLabel.setText("0");

        jLabel18.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel18.setText("Antal hold:");

        jLabel19.setFont(new java.awt.Font("Lucida Grande", 1, 13));
        jLabel19.setText("Antal noter:");

        countNotesLabel.setText("0");

        countTeamsLabel.setText("0");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(countMembersLabel)
                    .addComponent(countContingentLabel)
                    .addComponent(countMatchesLabel))
                .addGap(78, 78, 78)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addComponent(jLabel19)
                    .addComponent(jLabel18))
                .addGap(26, 26, 26)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(countTeamsLabel)
                    .addComponent(countNotesLabel)
                    .addComponent(countTrainersLabel))
                .addContainerGap(306, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(countMembersLabel)
                    .addComponent(jLabel16)
                    .addComponent(countTrainersLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(countContingentLabel)
                        .addComponent(jLabel18))
                    .addComponent(countTeamsLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(countMatchesLabel)
                    .addComponent(jLabel19)
                    .addComponent(countNotesLabel))
                .addContainerGap(24, Short.MAX_VALUE))
        );

        logoutBtn.setText("Log ud");
        logoutBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 829, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(name, javax.swing.GroupLayout.DEFAULT_SIZE, 617, Short.MAX_VALUE)
                                .addGap(11, 11, 11)
                                .addComponent(logoutBtn))
                            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel5)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(logoutBtn)
                            .addComponent(name))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Medlemskab
    // Søg en person
    private void searchPerson() {
        String name = this.nameField.getText();
        String cpr = this.cprField.getText();
        if (name.length() > 0 || cpr.length() > 0) {

            searchPersons = personCtr.searchPersons(name, cpr);
        }
        this.updatePersonList();
    }

    // Medlemskab
    // Opdatere listen over fundet personer
    private void updatePersonList() {
        DefaultListModel personListModel = new DefaultListModel();

        for (Person p : this.searchPersons) {
            personListModel.addElement(p.getName() + " (ID: " + p.getId() + ")");
        }

        personList.setModel(personListModel);
    }

    private void searchPersonBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchPersonBtnActionPerformed
        this.searchPerson();
    }//GEN-LAST:event_searchPersonBtnActionPerformed

    private void cprFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cprFieldKeyReleased
        // Hvis der bliver trykket Enter
        if (evt.getKeyCode() == 10) {
            this.searchPerson();
        }
    }//GEN-LAST:event_cprFieldKeyReleased

    private void nameFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameFieldKeyReleased
        // Hvis der bliver trykket Enter
        if (evt.getKeyCode() == 10) {
            this.searchPerson();
        }
    }//GEN-LAST:event_nameFieldKeyReleased

    private void logoutBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutBtnActionPerformed
        // Sletter vores nuværende session for den bruger der er logget ind
        Session.logout();

        // Kører garbage collectoren for at fjerne inaktive objekter fra ramene
        System.gc();

        // Looper alle åbne vinduer igennem
        for (Window window : Window.getWindows()) {
            // Lukker det vindue vi er kommet til
            window.dispose();
        }

        // Åbner login skærmen igen
        new LoginView().setVisible(true);
    }//GEN-LAST:event_logoutBtnActionPerformed

    private void txtsearchStorageNameKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtsearchStorageNameKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_txtsearchStorageNameKeyReleased

    private void txtSearchStorageSerialKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchStorageSerialKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_txtSearchStorageSerialKeyReleased

    private void searchBtn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchBtn1ActionPerformed
        DefaultListModel itemlistModel = new DefaultListModel();
        searchStorage = stoItemCtr.searchStorageItem(txtsearchStorageName.getText(), txtSearchStorageSerial.getText());
        for (StorageItem s : this.searchStorage) {
            itemlistModel.addElement("#" + s.getStorageId() + ": " + s.getStorageName() + "     " + s.getStorageAmount() + "stk." + "     Antal eksemplar" + s.getAmount());
        }
        listStorge.removeAll();
        listStorge.setModel(itemlistModel);
    }//GEN-LAST:event_searchBtn1ActionPerformed

    private void searchBtn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchBtn2ActionPerformed
       int selectedPerson = 0;
       int selectedMatriale = 0;
        
        if (ddPerson.getSelectedIndex() > 0 || ddMatriale.getSelectedIndex() > 0) {

            if (ddPerson.getSelectedIndex() > 0) {
                int index = ddPerson.getSelectedIndex();
                selectedPerson = personCtr.getAllPersons().get(index).getId();
            }
            
            if (ddMatriale.getSelectedIndex() > 0) {
                int index = ddMatriale.getSelectedIndex();
                selectedMatriale = stoItemCtr.getAllItems().get(index).getStoObj().getId();
            }
            
        }
        
        searchRent = rentCtr.getRent(selectedMatriale, selectedPerson);
        
        updateRentList();
    }//GEN-LAST:event_searchBtn2ActionPerformed

    private void updateRentList()
    {
        if (this.searchRent != null) {
            DefaultListModel itemlistModel = new DefaultListModel();
            for (Rent RentItem : this.searchRent) {
                itemlistModel.addElement("#" + RentItem.getPersonId() + "  " + " Person: " + personCtr.getPersonById(RentItem.getPersonId()).getName() + "  Udlåns dato: " + RentItem.getRentalDate() );
            }
            listRent.removeAll();
            listRent.setModel(itemlistModel);
        }
}
    private void createPersonBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createPersonBtnActionPerformed
        new PersonEditView().setVisible(true);
    }//GEN-LAST:event_createPersonBtnActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        new StorageView().setVisible(true);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void btnRedigerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRedigerActionPerformed
        if (listStorge.getSelectedIndex() > -1) {
            Storage s = searchStorage.get(listStorge.getSelectedIndex()).getStoObj();
            new StorageView(s).setVisible(true);
        }
    }//GEN-LAST:event_btnRedigerActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        new RentItem().setVisible(true);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed

        new RentEditView(searchRent.get(listRent.getSelectedIndex()).getRentItem() ).setVisible(true);
          
    }//GEN-LAST:event_jButton9ActionPerformed

    private void noteSearchBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noteSearchBtnActionPerformed
        this.noteSearch();
    }//GEN-LAST:event_noteSearchBtnActionPerformed

    private void noteSearch() {
        int isPublic = -1;

        // Hvis der kun skal vises private noter
        if (notePrivate.isSelected()) {
            isPublic = 0;

            // Hvis der kun skal vises offentlige noter
        } else if (notePublic.isSelected()) {
            isPublic = 1;
        }

        String text = this.noteTitle.getText();

        // Søger noter
        notesList = this.noteCtr.searchNotes(text, isPublic);

        updateNoteList();
    }

    // Opdatere listen over fundet noter
    private void updateNoteList() {
        DefaultListModel lm = new DefaultListModel();

        for (Note n : notesList) {
            lm.addElement(n.getTitle() + (n.isPublic() ? "" : " (Privat)"));
        }

        noteList.setModel(lm);
    }

    private void openNoteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openNoteBtnActionPerformed
        this.openNote();
    }//GEN-LAST:event_openNoteBtnActionPerformed

    // Finder den valgte note og åbner den
    private void openNote() {
        int index = noteList.getSelectedIndex();
        if (index >= 0) {
            int id = notesList.get(index).getId();
            if (id > 0) {
                new NoteView(id).setVisible(true);
            }
        }
    }

    // Medlemskab
    // Åbner den valgte person man har fundet
    private void selectPersonBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectPersonBtnActionPerformed
        int index = personList.getSelectedIndex();
        if (index >= 0) {
            Person person = searchPersons.get(index);
            if (person != null) {
                new PersonEditView(person.getId()).setVisible(true);
            }
        }
    }//GEN-LAST:event_selectPersonBtnActionPerformed

    private void createNoteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createNoteBtnActionPerformed
        // Opret en ny person
        new EditNoteView().setVisible(true);
    }//GEN-LAST:event_createNoteBtnActionPerformed

    private void noteTitleKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_noteTitleKeyReleased
        // Hvis der er trykket Enter
        if (evt.getKeyCode() == 10) {
            this.noteSearch();
        }
    }//GEN-LAST:event_noteTitleKeyReleased

    private void noteListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_noteListMouseClicked
        // Tjekker om der er dobbeltklikket på et element i listen
        if (evt.getClickCount() == 2) {
            this.openNote();
        }
    }//GEN-LAST:event_noteListMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainView().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRediger;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel countContingentLabel;
    private javax.swing.JLabel countMatchesLabel;
    private javax.swing.JLabel countMembersLabel;
    private javax.swing.JLabel countNotesLabel;
    private javax.swing.JLabel countTeamsLabel;
    private javax.swing.JLabel countTrainersLabel;
    private javax.swing.JTextField cprField;
    private javax.swing.JButton createNoteBtn;
    private javax.swing.JButton createPersonBtn;
    private javax.swing.JComboBox ddMatriale;
    private javax.swing.JComboBox ddPerson;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JList listRent;
    private javax.swing.JList listStorge;
    private javax.swing.JButton logoutBtn;
    private javax.swing.JLabel name;
    private javax.swing.JTextField nameField;
    private javax.swing.JRadioButton noteBoth;
    private javax.swing.JList noteList;
    private javax.swing.JRadioButton notePrivate;
    private javax.swing.JRadioButton notePublic;
    private javax.swing.JButton noteSearchBtn;
    private javax.swing.JTextField noteTitle;
    private javax.swing.JButton openNoteBtn;
    private javax.swing.JList personList;
    private javax.swing.JButton searchBtn1;
    private javax.swing.JButton searchBtn2;
    private javax.swing.JButton searchPersonBtn;
    private javax.swing.JButton selectPersonBtn;
    private javax.swing.JTextField txtSearchStorageSerial;
    private javax.swing.JTextField txtsearchStorageName;
    // End of variables declaration//GEN-END:variables
}
